import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

public class Demo08 {
    public static void main(String[] args) {
        Frame frame = new Frame();
        frame.setSize(500,500);
        frame.setTitle("安梓嘉专属按钮");
        Button button = new Button();
        button.setBounds(100,100,100,50);
//        button.setLabel("按钮");
        frame.setLayout(new FlowLayout());
        frame.add(button);

        button.addActionListener(
             new ActionListener() {
                 @Override
                 public void actionPerformed(java.awt.event.ActionEvent e) {
                  frame.setBackground(Color.RED);
                 }
             }
        );

        frame.setVisible(true);

    }
}
